﻿using System.Windows;

namespace BaseTypesControlLib.Controls
{
    public class BitmapFieldControl:FieldControl
    {
        public BitmapFieldControl()
        {
            DefaultStyleKey = typeof(BitmapFieldControl);
        }

        static BitmapFieldControl()
        {
            FrameworkPropertyMetadata fpm = new FrameworkPropertyMetadata(0,
                FrameworkPropertyMetadataOptions.AffectsMeasure |
                FrameworkPropertyMetadataOptions.AffectsArrange);
            HorizontalSpaceProperty = DependencyProperty.Register("HorizontalSpace", 
                typeof(int), typeof(BitmapFieldControl), fpm);

            fpm = new FrameworkPropertyMetadata(0,
                FrameworkPropertyMetadataOptions.AffectsMeasure |
                FrameworkPropertyMetadataOptions.AffectsArrange);
            VerticalSpaceProperty = DependencyProperty.Register("VerticalSpace",
                typeof(int), typeof(BitmapFieldControl), fpm);

            fpm = new FrameworkPropertyMetadata(null,
                FrameworkPropertyMetadataOptions.AffectsMeasure |
                FrameworkPropertyMetadataOptions.AffectsArrange);
            BitmapProperty = DependencyProperty.Register("Bitmap",
                typeof(string), typeof(BitmapFieldControl), fpm);
        }

        public int HorizontalSpace
        {
            get { return (int)GetValue(HorizontalSpaceProperty); }
            set { SetValue(HorizontalSpaceProperty, value); }
        }
        public static readonly DependencyProperty HorizontalSpaceProperty;

        public int VerticalSpace
        {
            get { return (int)GetValue(VerticalSpaceProperty); }
            set { SetValue(VerticalSpaceProperty, value); }
        }
        public static readonly DependencyProperty VerticalSpaceProperty;

        public string Bitmap
        {
            get { return (string)GetValue(BitmapProperty); }
            set { SetValue(BitmapProperty, value); }
        }
        public static readonly DependencyProperty BitmapProperty;
    }
}
